package database;



import java.util.HashMap;

/**
 * @author aioros
 * 
 * database xml
 */
public class Database {

	
	/*-------------------- Fields ------------------------*/
	
	/**
	 * database version
	 */
	private String version = "0";
	
	/**
	 * package list
	 */
	private HashMap<String,Package> packages = new HashMap<String,Package>();
	
	
	
	/*-------------------- Constructor ------------------------*/
	
	/**
	 * Build a Database
	 */
	public Database() {

	}
	
	
	
	/*-------------------- Methodes ------------------------*/
	
	
	public HashMap<String,Package> getPackages() {
		return packages;
	}



	public void setPackages(HashMap<String,Package> packages) {
		this.packages = packages;
	}


	public String getVersion() {
		return version;
	}




	public void setVersion(String version) {
		this.version = version;
	}


	public String toString(){
		
		
		String sdatabase = " \n";
		
		sdatabase += "################ version :" + version + " ################## \n \n";
		
		for (Package pck : packages.values()){
			
			sdatabase += pck + "\n";
		}
	
		return sdatabase;
	}

	
}
